//==================================================================================
//		Dual Quad Board Program
//		file name : Display_Mode.C
//		version : 1.0
//		target device : w78e516(winbond)
//		target board : dual quad board
//		c compiler : Keil
//==================================================================================
void Display_Full(U8 ch_num);
void Display_Quad(U8 ch_num, U8 ch_pos);
void Display_PIP_Initial(U8 ch_num);
void Display_8ch();		
//void Menu_Small_Mode_Display(); 
void realtime_8ch_initial();	
void Pseudo_16ch_On_Initial();
//void Pseudo_8ch_Off_Initial();
void Menu_Full_Mode_Display();
void Motion_PIP_Mode_Display();
void Display_2_splite(U8 ch_num);
void Display_8ch_AB();

extern void Channel_Pos_Setup(U8 ch_num, U8 pic_hl, U8 pic_vt, U8 pic_hr, U8 pic_vb);
//extern void Ana_Sw_Function(U8 ch_num);
extern void Pip_Channel_Pos_Setup(U8 ch_num, U8 ch_pos);
//extern void Enter_Font_display(U8 x_loc);
//extern void Menu_Exit_Font_display(U8 x_loc);
//==================================================================================
//Full Display//
//
//
//
//==================================================================================

//void ClearOSD(U8 ch_num)
//{

//}
void Display_Full(U8 ch_num)
{                                            										//Set picture size to D1 for every channel for X path
	U16 m_s;

	if(display_mode_backup==REALTIME_8CH || (display_mode_backup==REALTIME_7PLUS1))
		Register_Setup(ch_num, 0xfa, 0x04, 1);
	Register_Setup(ch_num, 0x03, 0x80, 0);
	
	if(ch_num < 4)
		m_s= MASTER;
	else
		m_s= SLAVE1;
	
	WriteAsicByte(m_s, DVC_PG0, 0x02 +(ch_num %4) *0x10, 0x22);							//... Horizontal Delay
	WriteAsicByte(m_s, DVC_PG0, 0x81 +(ch_num %4) *0x10, 0xff);							//... Vertical scaling ratio
	WriteAsicByte(m_s, DVC_PG0, 0x83 +(ch_num %4) *0x10, 0xff);							//... Horizontal scaling ratio
	WriteAsicByte(m_s, DVC_PG0, 0x80 +(ch_num %4) *0x10, ((ch_num %4) << 6)|0x01);  		//Set vertical and Horizontal anti-aliasing filter for X path
//	WriteAsicByte(temp, DVC_PG0, 0x8a +(ch_num %4) *0x10, ((ch_num %4) << 6)|0x01);   			//Set vertical and Horizontal anti-aliasing filter for Y path
	
	if(b_video_fmt == NTSC) {
		WriteAsicByte(m_s, DVC_PG0, 0x06+(ch_num %4) *0x10, 0x08);						//... Horizontal Delay HDELAY_XY[9:8]
		WriteAsicByte(m_s, DVC_PG0, 0x0b+(ch_num %4) *0x10, 0x02);		       			//... Comb, Trap Filter
		WriteAsicByte(m_s, DVC_PG0, 0xc5, 0x00);											//... Set PAL delay for X and Y path
		WriteAsicByte(m_s, DVC_PG0, 0x01+(ch_num %4)*0x10, 0xc8);			                                  //Enable the AGC
	}
	else	 {
		WriteAsicByte(m_s, DVC_PG0, 0x06 +(ch_num %4) *0x10, 0x28);						//... Horizontal Delay HDELAY_XY[9:8]
		WriteAsicByte(m_s, DVC_PG0, 0x0b +(ch_num %4) *0x10, 0x82);						//... Comb, Trap Filter
		WriteAsicByte(m_s, DVC_PG0, 0xc5, 0x0f);		            								 //... Set PAL delay for X and Y path
		WriteAsicByte(m_s, DVC_PG0, 0x01+(ch_num %4)*0x10, 0x88);			                                  //Enable the AGC
	}
		
	if(b_video_fmt == NTSC) 
		Channel_Pos_Setup(ch_num, 0x00, 0x00, 0xb4, 0x78);
	else
		Channel_Pos_Setup(ch_num, 0x00, 0x00, 0xb4, 0x90);	

	for(m_s = 0; m_s <8; m_s++){
		if(m_s !=ch_num)
			Register_Setup(m_s, 0x03, 0x00, 0);
		Register_Setup(m_s, 0xb7, 0x00, 1);
	}

	if(display_mode_backup==REALTIME_8CH){
		for(m_s= 0; m_s<=20200; m_s++);
		Register_Setup(ch_num, 0xfb, 0x00, 1);
	}
//	m_s = I2C_Data_Read(rom_p0, 0x03);
	//Display Setup "Title"			1: ON  0: OFF
	if(title_display== ON) {
		Camera_Title_Display();
              //language = 1;
              //Enter_Font_display(200);
              //Menu_Exit_Font_display(200);
       }
}

//==================================================================================
//
//
//
//
//
//==================================================================================
//... QUAD Display
void Display_Quad(U8 ch_num, U8 ch_pos)
{
	U8 m_s;

	if(ch_num < 4)
		m_s= MASTER;
	else
		m_s= SLAVE1;
	
	if(b_video_fmt == NTSC) {
		WriteAsicByte(m_s, DVC_PG0, 0x06+(ch_num %4) *0x10, 0x08);			//... Horizontal Delay HDELAY_XY[9:8]   
		WriteAsicByte(m_s, DVC_PG0, 0x0b+(ch_num %4) *0x10, 0x02);			//... Comb, Trap Filter
//		WriteAsicByte(m_s, DVC_PG0, 0x05+(ch_num %4) *0x10, 0xf0);		
		WriteAsicByte(m_s, DVC_PG0, 0x01+(ch_num %4)*0x10, 0xc8);			                                  //Enable the AGC
	}
	else {
		WriteAsicByte(m_s, DVC_PG0,0x06+(ch_num %4) *0x10, 0x28);			//... Horizontal Delay HDELAY_XY[9:8]   
		WriteAsicByte(m_s, DVC_PG0,0x0b+(ch_num %4) *0x10, 0x82);			//... Comb, Trap Filter
//		WriteAsicByte(m_s, DVC_PG0,0x05+(ch_num %4) *0x10, 0x20);			
		WriteAsicByte(m_s, DVC_PG0, 0x01+(ch_num %4)*0x10, 0x88);			                                  //Enable the AGC
	}
	WriteAsicByte(m_s, DVC_PG0,0x80+(ch_num %4) *0x10, ((ch_num %4)<<6)|0x01);        //Set vertical and Horizontal anti-aliasing filter for X path
//	WriteAsicByte(temp, DVC_PG0,0x8a+0x10*i, (i<<6)|0x31);       							 //Set vertical and Horizontal anti-aliasing filter for Y path
	WriteAsicByte(m_s, DVC_PG0, 0x02+(ch_num %4) *0x10, 0x28);						//... Horizontal Delay HDELAY_XY[7:0]    
	WriteAsicByte(m_s, DVC_PG0, 0x81+(ch_num %4) *0x10, 0x85);					//... Vertical scaling ratio
	WriteAsicByte(m_s, DVC_PG0, 0x83+(ch_num %4) *0x10, 0x85);						//... Horizontal scaling ratio
	WriteAsicByte(m_s, DVC_PG0, 0xc5, 0x00);			                     					//... Set PAL delay for X and Y path 

	if(b_video_fmt == NTSC)
	{
		switch(ch_pos)
		{
			case 1 :
					Channel_Pos_Setup(ch_num, 0x00, 0x00, 0x5a, 0x3c);
					break;
			case 2 :
					Channel_Pos_Setup(ch_num, 0x5a, 0x00, 0xb4, 0x3c);
					break;
			case 3 :
				 	Channel_Pos_Setup(ch_num, 0x00, 0x3c, 0x5a, 0x78);
					break;
			case 4 :
					Channel_Pos_Setup(ch_num, 0x5a, 0x3c, 0xb4, 0x78);
					break;
		}
	}	
	else
	{
		switch(ch_pos)
		{
			case 1 :
					Channel_Pos_Setup(ch_num, 0x00, 0x00, 0x5a, 0x48);
					break;
			case 2 :
					Channel_Pos_Setup(ch_num, 0x5a, 0x00, 0xb4, 0x48);
					break;
			case 3 :
				 	Channel_Pos_Setup(ch_num, 0x00, 0x48, 0x5a, 0x90);
					break;
			case 4 :
					Channel_Pos_Setup(ch_num, 0x5a, 0x48, 0xb4, 0x90);
					break;
		}
	}
	Register_Setup(ch_num, 0x03, 0x80, 0);
	
//	temp = I2C_Data_Read(rom_p0, 0x03);		//... Display Setup "Title"			1: ON  0: OFF
//	if((temp == ON) && (vcr_mode_in == OFF))
//		Camera_Title_Display();       
}

//==================================================================================
//
//
//
//
//
//==================================================================================
//... 2 Splite Display
void Display_2_splite(U8 ch_num)
{
	U8 m_s;

	if(ch_num < 4)
		m_s= MASTER;
	else
		m_s= SLAVE1;
	
	WriteAsicByte(m_s, DVC_PG0, 0x81+(ch_num %4) *0x10, 0xff);						//... Vertical scaling ratio
	WriteAsicByte(m_s, DVC_PG0, 0x83+(ch_num %4) *0x10, 0xff);						//... Horizontal scaling ratio
	WriteAsicByte(m_s, DVC_PG0, 0x80+(ch_num %4) *0x10, ((ch_num %4)<<6)|0x01);        //Set vertical and Horizontal anti-aliasing filter for X path
//	WriteAsicByte(temp, DVC_PG0, 0x8a+0x10 *(ch_num %4),((ch_num %4)<<6)|0x31);        	//Set vertical and Horizontal anti-aliasing filter for Y path	
	WriteAsicByte(m_s, DVC_PG0, 0x02 +(ch_num %4) *0x10, 0x22);							//... Horizontal Delay
	if(b_video_fmt == NTSC) {
		WriteAsicByte(m_s, DVC_PG0,0x06+(ch_num %4) *0x10, 0x08);
		WriteAsicByte(m_s, DVC_PG0,0x0b+(ch_num %4) *0x10, 0x02);					//... Comb, Trap Filter
		WriteAsicByte(m_s, DVC_PG0, 0xc5, 0x00);			                     				//... Set PAL delay for X and Y path 
		WriteAsicByte(m_s, DVC_PG0, 0x01+(ch_num %4)*0x10, 0xc8);			                                  //Enable the AGC
	}
	else	 {
		WriteAsicByte(m_s, DVC_PG0,0x06+(ch_num %4) *0x10, 0x28);
		WriteAsicByte(m_s, DVC_PG0,0x0b+(ch_num %4) *0x10, 0x82);					//... Comb, Trap Filter
		WriteAsicByte(m_s, DVC_PG0,0xc5,0x0f);			                     				//... Set PAL delay for X and Y path 
		WriteAsicByte(m_s, DVC_PG0, 0x01+(ch_num %4)*0x10, 0x88);			                                  //Enable the AGC
	}

	if(b_video_fmt == NTSC)
	{
		if(ch_num == pip_full_ch)
			Channel_Pos_Setup(ch_num, 0x00, 0x00, 0x5a, 0x78);
		else if(ch_num == pip_sub_ch_1)
			Channel_Pos_Setup(ch_num, 0x5a, 0x00, 0xb4, 0x78);
	}	
	else
	{
		if(ch_num == pip_full_ch)
			Channel_Pos_Setup(ch_num, 0x00, 0x00, 0x5a, 0x90);		
		else if(ch_num == pip_sub_ch_1)
			Channel_Pos_Setup(ch_num, 0x5a, 0x00, 0xb4, 0x90);
	}

	Register_Setup(ch_num, 0x03, 0x80, 0);
	
//	m_s = I2C_Data_Read(rom_p0, 0x03);							//... Display Setup "Title"			1: ON  0: OFF
	if((title_display== ON) && (vcr_mode_in == OFF)) 
		Camera_Title_Display();
}

//==================================================================================
//
//
//
//
//
//==================================================================================
//... PIP Display
void Display_PIP_Initial(U8 ch_num)
{                                                      							 //Set parameter such as anti_aliasing filter ,comb,H and V delay,etc for all path
	U8 m_s;

	if(ch_num < 4)
		m_s= MASTER;
	else
		m_s= SLAVE1;
	
	if(b_video_fmt == NTSC) {
//		WriteAsicByte(temp, DVC_PG0, 0x80 +0x10*(pip_sub_ch_1 %4), ((pip_sub_ch_1%4)<<6)|0x01);		//... Vertical anti-aliasing filter for X path  
//		WriteAsicByte(ALL_CHIP,DVC_PG0,0x8a+0x10*(pip_sub_ch_1%4),((pip_sub_ch_1%4)<<6)|0x31);		//... Vertical anti-aliasing filter for Y path  
		WriteAsicByte(m_s, DVC_PG0, 0x06+ 0x10 *(ch_num %4), 0x08);								//... Horizontal Delay HDELAY_XY[9:8]
		WriteAsicByte(m_s, DVC_PG0, 0x0b+0x10 *(ch_num %4), 0x02);								//... Comb, Trap Filter
		WriteAsicByte(m_s, DVC_PG0, 0x01+(ch_num %4)*0x10, 0xc8);									 //Enable the AGC
	}
	else {
//		WriteAsicByte(temp, DVC_PG0, 0x80+0x10*(pip_sub_ch_1%4),((pip_sub_ch_1%4)<<6)|0x01);			//... Vertical anti-aliasing filter for X path  
//		WriteAsicByte(ALL_CHIP,DVC_PG0,0x8a+0x10*(pip_sub_ch_1%4),((pip_sub_ch_1%4)<<6)|0x31);		//... Vertical anti-aliasing filter for Y path  
		WriteAsicByte(m_s, DVC_PG0, 0x06 +0x10 *(ch_num %4), 0x28);								//... Horizontal Delay HDELAY_XY[9:8]
		WriteAsicByte(m_s, DVC_PG0, 0x0b +0x10 *(ch_num %4), 0x82);								//... Comb, Trap Filter
		WriteAsicByte(m_s, DVC_PG0, 0x01+(ch_num %4)*0x10, 0x88);									 //Enable the AGC
	}

	WriteAsicByte(m_s, DVC_PG0, 0x01+(ch_num %4)*0x10, 0x08);									 //Enable the AGC
	WriteAsicByte(m_s, DVC_PG0, 0x81+0x10 *(ch_num %4), 0x56);									//... Vertical scaling ratio
	WriteAsicByte(m_s, DVC_PG0, 0x83+0x10 *(ch_num %4), 0x56);									//... Horizontal scaling ratio
	WriteAsicByte(m_s, DVC_PG0, 0xc5,0x00);														//Set PAL_DLY=0 (Vertical scaling mode is selected in chrominance path (default))

	WriteAsicByte(m_s, DVC_PG0, 0x02 +(ch_num %4) *0x10, 0x22);									//... Horizontal Delay
	WriteAsicByte(m_s, DVC_PG0, 0x80 +(ch_num %4) *0x10, ((ch_num %4) << 6)|0x01);  		 		//Set vertical and Horizontal anti-aliasing filter for X path
//	WriteAsicByte(temp, DVC_PG0, 0x8a +i *0x10, (i << 6)|0x01);   										//Set vertical and Horizontal anti-aliasing filter for Y path	

	if(ch_num == pip_sub_ch_1)
	{
		if(display_mode == PIP2_MODE)
			m_s = (I2C_Data_Read(rom_p0, 0x08) &0xf0) >> 4;	
		else
			m_s = I2C_Data_Read(rom_p0, 0x07) &0x0f;							//... Display Setup "PIP2 Mode"		1: Right Bottom  2: Left Bottom 3: Left Top 4: Right Top

		Pip_Channel_Pos_Setup(pip_sub_ch_1, m_s);
	}
	else if(ch_num == pip_sub_ch_2)
	{
		m_s = I2C_Data_Read(rom_p0, 0x08) &0x0f;								//... Display Setup "PIP2 Mode"		1: Right Bottom  2: Left Bottom 3: Left Top 4: Right Top			
		Pip_Channel_Pos_Setup(pip_sub_ch_2, m_s);
	}
	Register_Setup(ch_num, 0x03, 0xc0, 0);
}

//==================================================================================
//function : display 8ch realtime video, one big image and seven small image
//input     : null 
//output   : null
//return   : null
//author  : 
//==================================================================================
void Display_8ch_AB()
{
	U8 i,temp_n_p, temp_x;

	for(i = 0; i <8; i++)
	{
		Register_Setup(i, 0x03, 0x80, 0);
		Register_Setup(i, 0xba, 0x00, 1);
	}
	
	WriteAsicByte(MASTER, DVC_PG0, 0x4d, 0x00);
//	WriteAsicByte(MASTER,DVC_PG0,0xc8,0x07);								//Set FLDOS=0 for all path (Remove the field offset between ODD and EVEN)
	WriteAsicByte(ALL_CHIP, DVC_PG0, 0x43, 0x4f);			       			//... Gain Time
	WriteAsicByte(ALL_CHIP, DVC_PG0, 0x45, 0x12);				   			//... field mode

	for(i = 0; i < 4; i++) 
	{	
		if(b_video_fmt == NTSC) {
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x0b+0x10 *i, 0x02);			//... Comb, Trap Filter
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x08);			//... Horizontal Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x01+0x10 *i, 0xc8);			 //Enable the AGC
		}
		else {
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x0b+0x10 *i, 0x82);			//... Comb, Trap Filter
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x28);			//... Horizontal Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x01+0x10 *i, 0x88);			 //Enable the AGC
		}
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x80+0x10 *i, (i<<6)|0x06);        		//Set vertical and Horizontal anti-aliasing filter for X path
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x02+0x10 *i, 0x2d);				//... Horizontal Delay
		if(i == 0)
		{
			WriteAsicByte(MASTER, DVC_PG0, 0x81, 0xc8);				//... Vertical scaling ratio     VSCALE_X[15..8]
			WriteAsicByte(MASTER, DVC_PG0, 0x83, 0xc8);				//... Horizontal scaling ratio  HSCALE_X[15..8]
			WriteAsicByte(SLAVE1, DVC_PG0, 0x81, 0x3f);				//... Vertical scaling ratio     VSCALE_X[15..8]
			WriteAsicByte(SLAVE1, DVC_PG0, 0x83, 0x3f);				//... Horizontal scaling ratio  HSCALE_X[15..8]
		}else{
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x81+0x10 *i, 0x43);				//... Vertical scaling ratio     VSCALE_X[15..8]
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x83+0x10 *i, 0x43);				//... Horizontal scaling ratio  HSCALE_X[15..8]
		}
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x85+0x10 *i, 0x06);
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0xc5, 0x00);		  		      		 //Set PAL_DLY=0 (Vertical scaling mode is selected in chrominance path (default))
		
	}

	if(b_video_fmt == NTSC)	temp_n_p =0x1e;
	else	 temp_n_p =0x24;
	
	Channel_Pos_Setup(0, 0x00, 0x00, 0x87, temp_n_p*3);
	Channel_Pos_Setup(1, 0x87, 0x00, 0xb4, temp_n_p);
	Channel_Pos_Setup(2, 0x87, temp_n_p, 0xb4, temp_n_p*2);
	Channel_Pos_Setup(3, 0x87, temp_n_p*2, 0xb4, temp_n_p*3);
	
	for(i =0; i <4; i++)
	{
		temp_x = (i%4)*0x2d;
		Channel_Pos_Setup(i+4, temp_x, temp_n_p*3, temp_x+0x2d, temp_n_p*4);
	}
	
//	i = I2C_Data_Read(rom_p0, 0x03);		//... Display Setup "Title"			1: ON  0: OFF
	if(title_display== ON)
		Camera_Title_Display();
}

//==================================================================================
//function : display 8ch realtime video
//input     : null 
//output   : null
//return   : null
//author  : 
//==================================================================================
void Display_8ch()
{
	U8 i, temp_n_p, temp_x, temp_y;

	for(i=0; i<8; i++)
	{
		Register_Setup(i, 0x03, 0x80, 0);
		Register_Setup(i, 0xba, 0x00, 1);
	}
	
	WriteAsicByte(MASTER, DVC_PG0, 0x4d, 0x00);
        //WriteAsicByte(MASTER,DVC_PG0,0xc8,0x07);								//Set FLDOS=0 for all path (Remove the field offset between ODD and EVEN)
	WriteAsicByte(ALL_CHIP, DVC_PG0, 0x43, 0x4f);			       			//... Gain Time
	WriteAsicByte(ALL_CHIP, DVC_PG0, 0x45, 0x12);				   			//... field mode

	for(i = 0; i < 4; i++) 
	{	
		if(b_video_fmt == NTSC) {
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x0b+0x10 *i, 0x02);			//... Comb, Trap Filter
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x08);			//... Horizontal Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x01+0x10 *i, 0xc8);			//Enable the AGC
		}
		else {
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x0b+0x10 *i, 0x82);			//... Comb, Trap Filter
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x28);			//... Horizontal Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x01+0x10 *i, 0x88);			 //Enable the AGC
		}
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x80+0x10 *i, (i<<6)|0x06);        		//Set vertical and Horizontal anti-aliasing filter for X path
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x02+0x10 *i, 0x2d);				//... Horizontal Delay
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x81+0x10 *i, 0x58);//0x56			//... Vertical scaling ratio     VSCALE_X[15..8]
              //WriteAsicByte(ALL_CHIP,DVC_PG0,(0x82+(0x10*i)) ,0x57);//0x56			//... Vertical scaling ratio	   VSCALE_X[7..0]
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x83+0x10 *i, 0x58);//0x56			//... Horizontal scaling ratio  HSCALE_X[15..8]
              //WriteAsicByte(ALL_CHIP,DVC_PG0,(0x84+(0x10*i)) ,0x57);//0x56			//... Vertical scaling ratio     HSCALE_X[7..0]
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x85+0x10 *i, 0x06);
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0xc5, 0x00);		  		      		 //Set PAL_DLY=0 (Vertical scaling mode is selected in chrominance path (default))
		
	}

	if(b_video_fmt == NTSC)
		temp_n_p =0x28;
	else
		temp_n_p =0x30;

	for(i =0; i <9; i++)
	{
		if(i == 4) continue;
		temp_x = (i%3)*0x3c;
		temp_y = (i/3)*temp_n_p;
		Channel_Pos_Setup(i-(i > 4 ? 1:0), temp_x, temp_y, temp_x+0x3c, temp_y+temp_n_p);
	}
	
       //i = I2C_Data_Read(rom_p0, 0x03);		//... Display Setup "Title"			1: ON  0: OFF
	if(title_display== ON)
		Camera_Title_Display();
}

static U8 pre_big_ch = 0xff;



void Enable_6ch(U8 ch_num)
{
	U8 i;
	//display_mode_backup= REALTIME_7PLUS1;
	ch_num = ch_num - 1;
	if( ch_num > 5 )
	{
		return;
	}

	for(i=0; i<8; i++)
	{
		Register_Setup(i, 0x03, 0x0, 0);
		Register_Setup(i, 0xba, 0x04, 1);
	}

	WriteAsicByte(MASTER, DVC_PG0, 0x4d, 0x00);
        //WriteAsicByte(MASTER,DVC_PG0,0xc8,0x07);								//Set FLDOS=0 for all path (Remove the field offset between ODD and EVEN)
	WriteAsicByte(ALL_CHIP, DVC_PG0, 0x43, 0x4f);			       			//... Gain Time
	WriteAsicByte(ALL_CHIP, DVC_PG0, 0x45, 0x12);				   			//... field mode

	for(i = 0; i < 4; i++) 
	{	
		if(b_video_fmt == NTSC) {
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x0b+0x10 *i, 0x02);			//... Comb, Trap Filter
//			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x08);			//... Horizontal Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x08);			//... vertical Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x04+0x10 *i, 0x06);				//... vertical Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x05+0x10 *i, 0xf3);				//... vertical active
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x01+0x10 *i, 0xc8);			//Enable the AGC
		}
		else {
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x0b+0x10 *i, 0x82);			//... Comb, Trap Filter
//			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x28);			//... Horizontal Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x28);			//... vertical Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x04+0x10 *i, 0x05);				//... vertical Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x05+0x10 *i, 0x20);				//... vertical active
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x01+0x10 *i, 0x88);			 //Enable the AGC
		}
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x80+0x10 *i, (i<<6)|0x06);        		//Set vertical and Horizontal anti-aliasing filter for X path
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x02+0x10 *i, 0x20);				//... Horizontal Delay
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x03+0x10 *i, 0xd0);				//... Horizontal active
		if(i==(ch_num)%4)
			continue;
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x81+0x10 *i, 0x56);			//... Vertical scaling ratio     VSCALE_X[15..8]
              //WriteAsicByte(ALL_CHIP,DVC_PG0,(0x82+(0x10*i)) ,0x57);//0x56			//... Vertical scaling ratio	   VSCALE_X[7..0]
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x83+0x10 *i, 0x56);			//... Horizontal scaling ratio  HSCALE_X[15..8]
              //WriteAsicByte(ALL_CHIP,DVC_PG0,(0x84+(0x10*i)) ,0x57);//0x56			//... Vertical scaling ratio     HSCALE_X[7..0]
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x85+0x10 *i, 0x06);
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0xc5, 0x00);		  		      		 //Set PAL_DLY=0 (Vertical scaling mode is selected in chrominance path (default))
		
	}
	if( ch_num >= 4){
		WriteAsicByte(MASTER, DVC_PG0, 0x81+0x10 *(ch_num-4), 0x56);			//... Vertical scaling ratio     VSCALE_X[15..8]
		WriteAsicByte(SLAVE1, DVC_PG0, 0x81+0x10 *(ch_num-4), 0xb0);			//... Vertical scaling ratio     VSCALE_X[15..8]  big picture
		WriteAsicByte(MASTER, DVC_PG0, 0x83+0x10 *(ch_num-4), 0x56);			//... Horizontal scaling ratio  HSCALE_X[15..8]	
		WriteAsicByte(SLAVE1, DVC_PG0, 0x83+0x10 *(ch_num-4), 0xb0);			//... Horizontal scaling ratio  HSCALE_X[15..8]	big picture	
	}
	else
	{
		WriteAsicByte(SLAVE1, DVC_PG0, 0x81+0x10 *(ch_num), 0x56);			//... Vertical scaling ratio     VSCALE_X[15..8]
		WriteAsicByte(MASTER, DVC_PG0, 0x81+0x10 *(ch_num), 0xb0);			//... Vertical scaling ratio     VSCALE_X[15..8]  big picture
		WriteAsicByte(SLAVE1, DVC_PG0, 0x83+0x10 *(ch_num), 0x56);			//... Horizontal scaling ratio  HSCALE_X[15..8]	
		WriteAsicByte(MASTER, DVC_PG0, 0x83+0x10 *(ch_num), 0xb0);			//... Horizontal scaling ratio  HSCALE_X[15..8]	big picture
	}
	WriteAsicByte(ALL_CHIP, DVC_PG0, 0xc5, 0x00);		  		      		 //Set PAL_DLY=0 (Vertical scaling mode is selected in chrominance path (default))
	for(i=0; i<8; i++)
	{
		Register_Setup(i, 0x03, 0x80, 0);
		Register_Setup(i, 0xba, 0x00, 1);
	}

}


void Display_6ch_specific(U8 ch_num)
{
		U8 i, temp_n_p, temp_x, temp_y;
		U8 pic_index = 0;
	//set up 6chs
		pre_big_ch = ch_num;
		Enable_6ch( ch_num);
		if(b_video_fmt == NTSC)
			temp_n_p =0x28;
		else
			temp_n_p =0x30;

		Channel_Pos_Setup((ch_num - 1 ), 0, 0x30, 0x3c*2, 0x30*3);
		for(i = 0 ; i < 6 ; i ++)
		{
			if( (ch_num - 1 )== i )
			{
				continue;
			}
			switch(pic_index)
			{
				case 0:
						temp_x = 0x00; temp_y = 0x00;
						break;
				case 1:
						temp_x = 0x3c; temp_y = 0x00;
						break;
				case 2:
						temp_x = 0x3c * 2; temp_y = 0x00;
						break;
				case 3:
						temp_x = 0x3c*2; temp_y = 0x30;
						break;
				case 4:
						temp_x = 0x3c*2; temp_y = 0x30 * 2;
						break;
			}
			Channel_Pos_Setup(i, temp_x, temp_y, temp_x + 0x3c, temp_y + temp_n_p);
			pic_index++;
		}
		if(title_display== ON)
		{
			Realtime_6ch_Title_Display(ch_num);
		}

	//	i = I2C_Data_Read(rom_p0, 0x03);		//... Display Setup "Title" 		1: ON  0: OFF
	//	if(title_display== ON)
	//		Camera_Title_Display();
}

#if 0
void Enable_8ch(U8 ch_num )
{
//set up 6chs
	U8 i;
	if( (ch_num > 8) || (ch_num ==0 ))
	{
		return;
	}
	for(i=0; i<8; i++)
	{
		Register_Setup(i, 0x03, 0x80, 0);
		Register_Setup(i, 0xba, 0x00, 1);
	}
	
	WriteAsicByte(MASTER, DVC_PG0, 0x4d, 0x00);
        //WriteAsicByte(MASTER,DVC_PG0,0xc8,0x07);								//Set FLDOS=0 for all path (Remove the field offset between ODD and EVEN)
	WriteAsicByte(ALL_CHIP, DVC_PG0, 0x43, 0x4f);			       			//... Gain Time
	WriteAsicByte(ALL_CHIP, DVC_PG0, 0x45, 0x12);				   			//... field mode

	for(i = 0; i < 4; i++) 
	{	
		if(b_video_fmt == NTSC) {
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x0b+0x10 *i, 0x02);			//... Comb, Trap Filter
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x08);			//... Horizontal Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x01+0x10 *i, 0xc8);			//Enable the AGC
		}
		else {
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x0b+0x10 *i, 0x82);			//... Comb, Trap Filter
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x28);			//... Horizontal Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x01+0x10 *i, 0x88);			 //Enable the AGC
		}
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x80+0x10 *i, (i<<6)|0x06);        		//Set vertical and Horizontal anti-aliasing filter for X path
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x02+0x10 *i, 0x1d);				//... Horizontal Delay
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x81+0x10 *i, 0x58);//0x56			//... Vertical scaling ratio     VSCALE_X[15..8]
              //WriteAsicByte(ALL_CHIP,DVC_PG0,(0x82+(0x10*i)) ,0x57);//0x56			//... Vertical scaling ratio	   VSCALE_X[7..0]
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x83+0x10 *i, 0x58);//0x56			//... Horizontal scaling ratio  HSCALE_X[15..8]
              //WriteAsicByte(ALL_CHIP,DVC_PG0,(0x84+(0x10*i)) ,0x57);//0x56			//... Vertical scaling ratio     HSCALE_X[7..0]
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x85+0x10 *i, 0x06);
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0xc5, 0x00);		  		      		 //Set PAL_DLY=0 (Vertical scaling mode is selected in chrominance path (default))
		
	}
	ch_num = ch_num - 1;
	if( ch_num >= 4)
	{
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x80+0x10 *(ch_num -4), (i<<6)|0x06);        		//Set vertical and Horizontal anti-aliasing filter for X path
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x02+0x10 *(ch_num -4), 0x0f);				//... Horizontal Delay
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x81+0x10 *(ch_num -4), 0xf3);//0x56			//... Vertical scaling ratio     VSCALE_X[15..8]
              //WriteAsicByte(ALL_CHIP,DVC_PG0,(0x82+(0x10*i)) ,0x57);//0x56			//... Vertical scaling ratio	   VSCALE_X[7..0]
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x83+0x10 *(ch_num -4), 0xf3);//0x56			//... Horizontal scaling ratio  HSCALE_X[15..8]
              //WriteAsicByte(ALL_CHIP,DVC_PG0,(0x84+(0x10*i)) ,0x57);//0x56			//... Vertical scaling ratio     HSCALE_X[7..0]
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x85+0x10 *(ch_num -4), 0x06);
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0xc5, 0x00);		  		      		 //Set PAL_DLY=0 (Vertical scaling mode is selected in chrominance path (default))
	}
}
#endif

void Enable_8ch(U8 ch_num )
{
	U8 i;
	display_mode_backup= REALTIME_7PLUS1;
	ch_num = ch_num - 1;
	if( ch_num > 7 )
	{
		return;
	}

	for(i=0; i<8; i++)
	{
		Register_Setup(i, 0x03, 0x0, 0);
	}

	WriteAsicByte(MASTER, DVC_PG0, 0x4d, 0x00);
        //WriteAsicByte(MASTER,DVC_PG0,0xc8,0x07);								//Set FLDOS=0 for all path (Remove the field offset between ODD and EVEN)
	WriteAsicByte(ALL_CHIP, DVC_PG0, 0x43, 0x4f);			       			//... Gain Time
	WriteAsicByte(ALL_CHIP, DVC_PG0, 0x45, 0x12);				   			//... field mode

	for(i = 0; i < 4; i++) 
	{	
		if(b_video_fmt == NTSC) {
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x0b+0x10 *i, 0x02);			//... Comb, Trap Filter
//			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x08);			//... Horizontal Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x08);			//... vertical Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x04+0x10 *i, 0x06);				//... vertical Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x05+0x10 *i, 0xf0);				//... vertical active
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x01+0x10 *i, 0xc8);			//Enable the AGC
		}
		else {
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x0b+0x10 *i, 0x82);			//... Comb, Trap Filter
//			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x28);			//... Horizontal Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x28);			//... vertical Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x04+0x10 *i, 0x05);				//... vertical Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x05+0x10 *i, 0x20);				//... vertical active
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x01+0x10 *i, 0x88);			 //Enable the AGC
		}
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x80+0x10 *i, (i<<6)|0x06);        		//Set vertical and Horizontal anti-aliasing filter for X path
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x02+0x10 *i, 0x20);				//... Horizontal Delay
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x03+0x10 *i, 0xd0);				//... Horizontal active
		if(i==(ch_num)%4)
			continue;
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x81+0x10 *i, 0x3F);			//... Vertical scaling ratio     VSCALE_X[15..8]
              //WriteAsicByte(ALL_CHIP,DVC_PG0,(0x82+(0x10*i)) ,0x57);//0x56			//... Vertical scaling ratio	   VSCALE_X[7..0]
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x83+0x10 *i, 0x3F);			//... Horizontal scaling ratio  HSCALE_X[15..8]
              //WriteAsicByte(ALL_CHIP,DVC_PG0,(0x84+(0x10*i)) ,0x57);//0x56			//... Vertical scaling ratio     HSCALE_X[7..0]
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x85+0x10 *i, 0x06);
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0xc5, 0x00);		  		      		 //Set PAL_DLY=0 (Vertical scaling mode is selected in chrominance path (default))
		
	}
	if( ch_num >= 4){
		WriteAsicByte(MASTER, DVC_PG0, 0x81+0x10 *(ch_num-4), 0x3f);			//... Vertical scaling ratio     VSCALE_X[15..8]
		WriteAsicByte(SLAVE1, DVC_PG0, 0x81+0x10 *(ch_num-4), 0xc4);			//... Vertical scaling ratio     VSCALE_X[15..8]  big picture
		WriteAsicByte(MASTER, DVC_PG0, 0x83+0x10 *(ch_num-4), 0x3f);			//... Horizontal scaling ratio  HSCALE_X[15..8]	
		WriteAsicByte(SLAVE1, DVC_PG0, 0x83+0x10 *(ch_num-4), 0xc4);			//... Horizontal scaling ratio  HSCALE_X[15..8]	big picture	
	}
	else{
		WriteAsicByte(SLAVE1, DVC_PG0, 0x81+0x10 *(ch_num), 0x3F);			//... Vertical scaling ratio     VSCALE_X[15..8]
		WriteAsicByte(MASTER, DVC_PG0, 0x81+0x10 *(ch_num), 0xC4);			//... Vertical scaling ratio     VSCALE_X[15..8]  big picture
		WriteAsicByte(SLAVE1, DVC_PG0, 0x83+0x10 *(ch_num), 0x3F);			//... Horizontal scaling ratio  HSCALE_X[15..8]	
		WriteAsicByte(MASTER, DVC_PG0, 0x83+0x10 *(ch_num), 0xc4);			//... Horizontal scaling ratio  HSCALE_X[15..8]	big picture
	}
	WriteAsicByte(ALL_CHIP, DVC_PG0, 0xc5, 0x00);		  		      		 //Set PAL_DLY=0 (Vertical scaling mode is selected in chrominance path (default))
	for(i=0; i<8; i++)
	{
		Register_Setup(i, 0x03, 0x80, 0);
		Register_Setup(i, 0xba, 0x00, 1);
	}

}

//===========8ch realtime display position index=======================

void Display_8ch_specific(U8 ch_num)
{
	U16 i, temp_n_p, temp_x, temp_y;
	U8 pic_index = 0;
		
	Printf("before Enable_8ch \n");
	pre_big_ch = ch_num;
	Enable_8ch( ch_num);
	Printf("after Enable_8ch \n");
	if(b_video_fmt == NTSC)
		temp_n_p =0x28;
	else
		temp_n_p =0x24;
		//temp_n_p =0x48;

	Channel_Pos_Setup( (ch_num - 1 ), 0, 0x24, 0x2d*3, 0x24*4);
	#if 0
	if(title_display== ON)
	{
		Write_osd(50 ,  188 , OSD_NOR, 0xc0 + ( ch_num - 1 )*4);
	}
	#endif
	for(i = 0 ; i < 8 ; i ++)
	{
		if( ( ch_num - 1 )== i )
		{
			continue;
		}

		if( pic_index < 4)
		{
			temp_x = 0x2d * pic_index;
			temp_y = 0x00;
		}
		else
		{
			temp_x = 0x2d * 3;
			temp_y = 0x24 * ( pic_index - 3 );
		}
		
		Channel_Pos_Setup(i, temp_x, temp_y, temp_x + 0x2d, temp_y + temp_n_p);
		#if 0
		if(title_display== ON)
		{
			Write_osd( temp_x +11, temp_y + 11, OSD_NOR, 0xc0 + i*4);
			Printf("Write_osd x = %x, y = %x \r\n",  temp_x +11, temp_y + 11);
		}
		#endif
		pic_index ++;
	}
	if(title_display== ON)
	{
		Realtime_7plus1_Title_Display( ch_num);
	}
//	i = I2C_Data_Read(rom_p0, 0x03);		//... Display Setup "Title" 		1: ON  0: OFF
//	if(title_display== ON)
//		Camera_Title_Display();
}

#if 0
 //==================================================================================
//function : display 8ch realtime video
//input     : null 
//output   : null
//return   : null
//author  : 
//==================================================================================
void Display_8ch()
{
	U8 i, temp_n_p, temp_x, temp_y;

	for(i=0; i<8; i++)
	{
		Register_Setup(i, 0x03, 0x80, 0);
		Register_Setup(i, 0xba, 0x00, 1);
	}
	
	WriteAsicByte(MASTER, DVC_PG0, 0x4d, 0x00);
        //WriteAsicByte(MASTER,DVC_PG0,0xc8,0x07);								//Set FLDOS=0 for all path (Remove the field offset between ODD and EVEN)
	WriteAsicByte(ALL_CHIP, DVC_PG0, 0x43, 0x4f);			       			//... Gain Time
	WriteAsicByte(ALL_CHIP, DVC_PG0, 0x45, 0x12);				   			//... field mode

	for(i = 0; i < 4; i++) 
	{	
		if(b_video_fmt == NTSC) {
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x0b+0x10 *i, 0x02);			//... Comb, Trap Filter
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x08);			//... Horizontal Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x01+0x10 *i, 0xc8);			//Enable the AGC
		}
		else {
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x0b+0x10 *i, 0x82);			//... Comb, Trap Filter
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x06+0x10 *i, 0x28);			//... Horizontal Delay
			WriteAsicByte(ALL_CHIP, DVC_PG0, 0x01+0x10 *i, 0x88);			 //Enable the AGC
		}
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x80+0x10 *i, (i<<6)|0x06);        		//Set vertical and Horizontal anti-aliasing filter for X path
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x02+0x10 *i, 0x2d);				//... Horizontal Delay
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x81+0x10 *i, 0x58);//0x56			//... Vertical scaling ratio     VSCALE_X[15..8]
              //WriteAsicByte(ALL_CHIP,DVC_PG0,(0x82+(0x10*i)) ,0x57);//0x56			//... Vertical scaling ratio	   VSCALE_X[7..0]
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x83+0x10 *i, 0x58);//0x56			//... Horizontal scaling ratio  HSCALE_X[15..8]
              //WriteAsicByte(ALL_CHIP,DVC_PG0,(0x84+(0x10*i)) ,0x57);//0x56			//... Vertical scaling ratio     HSCALE_X[7..0]
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0x85+0x10 *i, 0x06);
		WriteAsicByte(ALL_CHIP, DVC_PG0, 0xc5, 0x00);		  		      		 //Set PAL_DLY=0 (Vertical scaling mode is selected in chrominance path (default))
		
	}

	if(b_video_fmt == NTSC)
		temp_n_p =0x28;
	else
		temp_n_p =0x30;

	for(i =0; i <9; i++)
	{
		if(i == 4) continue;
		temp_x = (i%3)*0x3c;
		temp_y = (i/3)*temp_n_p;
		Channel_Pos_Setup(i-(i > 4 ? 1:0), temp_x, temp_y, temp_x+0x3c, temp_y+temp_n_p);
	}
	
       //i = I2C_Data_Read(rom_p0, 0x03);		//... Display Setup "Title"			1: ON  0: OFF
	if(title_display== ON)
		Camera_Title_Display();
}
#endif
//static U8 pre_big_ch = 0xff;


#if 0
void Display_6ch()
{
	U8 i, temp_n_p;//, temp_x, temp_y;

	Enable_6ch( 6);
	if(b_video_fmt == NTSC)
		temp_n_p =0x28;
	else
		temp_n_p =0x48;

	for(i = 0 ; i < 6 ; i ++)
	{
		Channel_Pos_Setup(i, POS_6CH[i*2], POS_6CH[i*2+1], POS_6CH[i*2] + 0x3c, POS_6CH[i*2+1] + temp_n_p);
		if(title_display== ON)
			Write_osd(POS_6CH[i*2]+4, POS_6CH[i*2+1]+8,OSD_NOR,0x3c+i*4);
	}
		
	//	i = I2C_Data_Read(rom_p0, 0x03);		//... Display Setup "Title" 		1: ON  0: OFF
	//	if(title_display== ON)
	//		Camera_Title_Display();
}
#endif

#if 0
//==================================================================================
//
//
//
//
//
//==================================================================================
//... Menu Mode Channel OFF
void Menu_Small_Mode_Display()
{
	U8 i;

	for(i=0;i<4;i++) {
		WriteAsicByte(ALL_CHIP, DVC_PG1,(0x30+(i * 0x04)),0x00);
		WriteAsicByte(ALL_CHIP, DVC_PG1,(0x31+(i * 0x04)),0x00);
		WriteAsicByte(ALL_CHIP, DVC_PG1,(0x32+(i * 0x04)),0x00);
		WriteAsicByte(ALL_CHIP, DVC_PG1,(0x33+(i * 0x04)),0x00);
	}
}

//==================================================================================
#endif

